#e
#Title[镄uFKN\v]
#Text[܂ЂǂEłA͂̃nb^B邱ƂɋCÂƁEEEyłB]

#BackGround[Default]
#BGM[.\BGM\thA07]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
	let count=181;
	let cx=GetCenterX();//STGV[̒SxW擾;
	let imgExRumia=GetCurrentScriptDirectory~"img\ExRumia.png";
	let imgExRumiaBack=GetCurrentScriptDirectory~"img\ExRumiaBack.png";
        let eco00=GetCurrentScriptDirectory~"SE\eco00.wav";
	let imgLittle=GetCurrentScriptDirectory~"img\RumiaCutIn.png";
	let imgeffect_magic=GetCurrentScriptDirectory~"img\effect_magic.png";
	let imgAngle=0;
	let flame=0;
        let BellA=GetCurrentScriptDirectory~"SE\BellA@16.wav";
	let imgback04_06=GetCurrentScriptDirectory~"img\back04_06.png";

	@Initialize
	{
		SetScore(30000);//XyJ[h{[iX30000ɐݒ
		SetLife(250);//Ct300ɐݒ
		SetDamageRate(10,3);//_[W10%ɐݒ
		SetTimer(60);//Ԑ60bɐݒ

		SetGraphicRect(1,1,64,64);//`挳`ݒ
		SetInvincibility(100);//G30t[Gɂ
		
		LoadGraphic(imgExRumia);//摜uimg\ExRumia.pngvǂ݂		
		LoadGraphic(imgeffect_magic); 
		LoadGraphic(imgback04_06);
                LoadSE(eco00);
		LoadSE(BellA);
		SetMovePosition02(cx,60,60);//W(cx,60)60t[Ĉړ
		Concentration01(150);
		CutIn(YOUMU,"镄uFKN\v",imgLittle,1,1,350,525);//XyJ[h\
	}
	
	@MainLoop
		{
			
			if(count==180){PlaySE(BellA);}
			
			if(count==80){PlaySE(BellA);}                       
       

			if(count==100)
			{//count100ɂȂs镔
				SetShotDirectionType(PLAYER);//e̊px@ɕύX
				let i=0;
				while(i<=1)
				{//(i=-20 ,0 ,20)3WAY
					let shot1=1;
					CreateShotA(shot1,GetX(),GetY(),30);//shot1쐻
					SetShotDataA(shot1,0,4,i,0,0,0,GREEN03);//ef[^ݒ(shot1)
					
					let j=-180;
					while(j<=180)
					{//(j=-15 ,0 ,15)3WAY
						let shot2=2;
						CreateShotA(shot2,0,0,10);//shot2쐻
						SetShotDataA(shot2,0,3,180+j,0,0,0,GREEN02);//ef[^ݒ(shot2)
	
						let k=-180;
						while(k<=180)
						{//(k=-30, -15 , 0 , 15, 30)5WAY
							let shot3=3;
							CreateShotA(shot3,0,0,10);//shot3쐻
							SetShotDataA(shot3,0,2,k,0,0,0,GREEN21);//ef[^ݒ(shot3)
							AddShot(60,shot2,shot3,0);//shot2shot3ǉ(60t[shot3o)
							k+=40;
						}
						SetShotKillTime(shot2,61);//ɏ
						AddShot(45,shot1,shot2,0);//shot1shot2ǉ(60t[shot2o)	
						j+=15;
					}
					SetShotKillTime(shot1,46);//ɏ
					FireShot(shot1);//e(shot1)𔭎
					i+=2;
				}
                        }

                        if(count==300){ 
                                       PlaySE(eco00);
					Concentration02(50);
                                       }
                        

                        if(count==360)
			{//count360ɂȂs镔
				SetShotDirectionType(PLAYER);//e̊px@ɕύX
				let i=0;
				while(i<=1)
				{//(i=-20 ,0 ,20)3WAY
					let shot1=1;
					CreateShotA(shot1,GetX(),GetY(),30);//shot1쐻
					SetShotDataA(shot1,0,4,i,0,0,0,PURPLE03);//ef[^ݒ(shot1)
					
					let j=-180;
					while(j<=180)
					{//(j=-15 ,0 ,15)3WAY
						let shot2=2;
						CreateShotA(shot2,0,0,10);//shot2쐻
						SetShotDataA(shot2,0,3,180+j,0,0,0,PURPLE02);//ef[^ݒ(shot2)
	
						let k=-180;
						while(k<=180)
						{//(k=-30, -15 , 0 , 15, 30)5WAY
							let shot3=3;
							CreateShotA(shot3,0,0,10);//shot3쐻
							SetShotDataA(shot3,0,2,k,0,0,0,PURPLE21);//ef[^ݒ(shot3)
							AddShot(60,shot2,shot3,0);//shot2shot3ǉ(60t[shot3o)
							k+=30;
						}
						SetShotKillTime(shot2,61);//ɏ
						AddShot(45,shot1,shot2,0);//shot1shot2ǉ(60t[shot2o)	
						j+=15;
					}
					SetShotKillTime(shot1,46);//ɏ
					FireShot(shot1);//e(shot1)𔭎
					i+=2;
				}
				count=0;//eocount0ɂ
			}
			SetCollisionA(GetX(),GetY(),64);//G̍Wɓ蔻o^
			SetCollisionB(GetX(),GetY(),24);//G̍Wɓ蔻(̓p)o^
			count++;//1t[count1
			flame++;


		}

	@Finalize
	{//ǂ݂񂾃t@C폜
		DeleteGraphic(imgExRumia);	
		DeleteGraphic(imgeffect_magic);
		DeleteGraphic(imgback04_06);
		CreateItem(ITEM_BOMB,GetX,GetY+60);
		loop(8)
		{
			CreateItem(ITEM_SCORE,GetX+rand(-100,100),GetY-rand(20,100));
		}
	}
		

	@DrawLoop
	{
		//Ex[~A`
		if(count>=150){SetGraphicRect(64,64,127,127)};
		if(count<150){SetGraphicRect(1,1,64,64);}
		SetGraphicAngle(0,0,0);
		SetAlpha(255);
		SetTexture(imgExRumia);
		DrawGraphic(GetX(),GetY());

		if(flame>0)
			{

			SetGraphicRect(0,80,150,230);
			SetAlpha(255);
			SetGraphicAngle(0,0,-imgAngle);
			SetTexture(imgeffect_magic);
			DrawGraphic(GetX(),GetY());
			imgAngle+=0.5;
			}

		if(flame>0)
			{

			SetGraphicRect(300,230,450,380);
			SetAlpha(255);
			SetGraphicAngle(0,0,imgAngle);
			SetTexture(imgeffect_magic);
			DrawGraphic(GetX(),GetY());
			imgAngle+=0.5;
			}
	}

	@BackGround
	{
	//XyJ[h̔wi
	//Ă悢

		SetTexture(imgback04_06);
		SetGraphicRect(1,1,512,512);
		SetAlpha(100);
		SetGraphicAngle(0,0,0);

		DrawGraphic(GetCenterX,GetCenterY);
	}
	

}